﻿#ifndef COMBINESPLITTABLEVIEW_H
#define COMBINESPLITTABLEVIEW_H

#include "mytableview.h"
#include "formula.h"
#include "productservice.h"

class CombineSplitTableView : public MyTableView
{
    Q_OBJECT
public:
    explicit CombineSplitTableView(QWidget *parent = nullptr);

    void insertFormula(QList<Formula*> formulas);

    void insertFormula(Formula &formula);

    void loadFormulas();

    Formula* currentFormula();

    void updateFormula();

    void clear();
signals:
    void refreshFormula();

public slots:
    void showMenu(const QPoint point);

private:
    QStringList header;
    QStandardItemModel *model;

    QList<Formula*> formulas;

    QMenu menu;

    ProductService productService;
};

#endif // COMBINESPLITTABLEVIEW_H
